package com.xmg.p2p.base.controller;

import com.xmg.p2p.base.service.IVerifyCodeService;
import com.xmg.p2p.base.util.JSONResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @BelongsProject: jinrong-website
 * @BelongsPackage: com.xmg.p2p.base.controller
 * @author: Andy
 * @date: 2021.3.11 11:06
 * @Description: 验证码相关的Controller
 * @since JDK 1.8
 */
@Controller
public class VerifyCodeController {
    @Autowired
    private IVerifyCodeService iVerifyCodeService;

    /**
     * 向手机号发送验证码
     * @param phoneNumber
     * @return
     */
    @RequestMapping("/sendVerifyCode")
    @ResponseBody
    public JSONResult sendVerifyCode(String phoneNumber){
        // 向手机号发送验证码
        iVerifyCodeService.sendVerifyCode(phoneNumber);
        return new JSONResult();
    }
}
